import request from '@/utils/request'

export interface RouterData {
  name: string
  path: string,
  hidden?: boolean,
  redirect?: string,
  component: string,
  alwaysShow?: boolean,
  meta: {
      title: string,
      icon?: string,
      noCache?: boolean,
      link?: string
  },
  children?: RouterData[]
} 


// 获取路由
const getRouters = () => {
  return request<{data: RouterData[]}>({
    url: '/getRouters',
    method: 'get'
  })
}

export default getRouters